//
//  Model.m
//  GLuckyTransport
//
//  Created by mac on 15/8/1.
//  Copyright (c) 2015年 mac. All rights reserved.
//

#import "ModelA.h"

#pragma mark - base

@implementation WebAPIModelResult{
    id            _resultObject;
    Class         _resultClass;
}

@synthesize message;
@synthesize error_code;
@synthesize success;
@synthesize result=_result;
@synthesize resultClass=_resultClass;
@synthesize resultObject = _resultObject;
@synthesize successI;
@synthesize error_codeI;

- (void)setResult:(NSObject *)Result{
    
    _result = nil;
    if (![Result isKindOfClass:[NSNull class]]) {
        _result = Result ;
    }
}

- (void)setResultClass:(Class)resultClass{
    if (self.result) {
        
        if ([self.result isKindOfClass:[NSDictionary class]]) {
            self.resultObject = [(NSDictionary*)self.result objectForClass:resultClass];
        }else if ([self.result isKindOfClass:[NSArray class]]){
            self.resultObject = [resultClass objectsFromArray:self.result];
        }else if ([self.result isKindOfClass:[NSNull class]]){
            self.resultObject = nil;
        }else{
            self.resultObject = self.result;
        }
    }
}

- (NSInteger)successI{
    return [self.success integerValue];
}

- (NSInteger)error_codeI{
    return [self.error_code integerValue];
}

- (void)dealloc
{
    self.message = nil;
    self.result = nil;
    self.success = nil;
    self.error_code = nil;
    self.resultObject = nil;
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - model base
@implementation NSString (ModelMock)

- (id)valueForUndefinedKey:(NSString *)key{
    
    if ([self rangeOfString:[HMWebAPI methodMock]].location!=NSNotFound) {
        id respondObject = nil;
        /*
         //message = "";
         //result =     {
         //    user = "\U767b\U5f55\U6210\U529f";
         //    pwd = 3;
         //};
         //error_code = 1;
         //success = 1;
         */
         NSDictionary *resultDic = [NSDictionary dictionaryWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"ModelResultClass" withExtension:@"plist"]];
        NSDictionary *data = [[[resultDic objectForKey:@"hyll"] objectForKey:@"commands"] objectForKey:key];
        
        if ([self isEqualToString:[HMWebAPI methodMock]]||[self isEqualToString:[HMWebAPI methodMockSuccess]]) {
            NSString *output = [data objectForKey:@"output"];

            respondObject = @{@"message": @"",@"error_code":@(0),@"success":@(1),@"result":[output notEmpty]?[output JSONObject]:@""};
            
        }else if ([self isEqualToString:[HMWebAPI methodMockFail]]) {
            NSString *output = [data objectForKey:@"outputFail"];
            
            respondObject = @{@"message": [NSString stringWithFormat:@"%@ 发生错误",key],@"error_code":@(1),@"success":@(0),@"result":[output notEmpty]?[output JSONObject]:@""};

        }else if ([self isEqualToString:[HMWebAPI methodMockTimeOut]]) {

            respondObject = @{@"message": @"服务器超时",@"error_code":@(-121),@"success":@(0),@"result":@""};
        }
        
        return respondObject;
    }else{
        return [super valueForUndefinedKey:key];
    }
}

@end

@implementation ModelA

+(void)load{
#if (__ON__ == __HM_DEVELOPMENT__)   
    NSDictionary *resultDic = [NSDictionary dictionaryWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"ModelResultClass" withExtension:@"plist"]];
    
    for (NSString *command in resultDic.allKeys) {

        NSDictionary *data = [resultDic objectForKey:command];
        NSDictionary *sample = [[data objectForKey:@"output"] JSONObject];
        NSDictionary *input = [[data objectForKey:@"input"] JSONObject];
        BOOL ok = [[data objectForKey:@"ok"] boolValue];

        CC( [self.class description],@"#pragma mark - ===========prit===========  ",command,@"",@"\n/*%@%@*/",[data objectForKey:@"des"],[data objectForKey:@"input"]);
//        NSMutableString *AS_STRING(publishCar)
//        DEF_STRING(publishCargo,@"publishCargo")
// NSString *  userid = [self doReStore:[CargoPresenter publishCargoIO_userid]];
        NSMutableString *as_string = [NSMutableString stringWithFormat:@"#pragma mark %@\nAS_STRING(%@)\n",command,command];
        NSMutableString *def_string = [NSMutableString stringWithFormat:@"#pragma mark %@\nDEF_STRING(%@,@\"%@\")\n",command,command,command];
        NSMutableString *restore_string = [NSMutableString stringWithFormat:@"#pragma mark %@\n- (void)doReset%@Attributes:(NSArray *)attributeBinded{\n\n}\n- (BOOL)doVerity%@Attributes:(NSArray*)attributeBinded{\n\nreturn YES;\n}\n- (void)do%@Attributes:(NSDictionary *)attributeBinded{\n\n",command,command,command,command];
        NSMutableString *send_string = [NSMutableString stringWithFormat:@"\nNSDictionary *dic = @{\n"];
        NSMutableString *test_string = [NSMutableString stringWithFormat:@"\n#ifdef DEBUG\n"];
        
        /*
         NSDictionary *dic = @{
         @"userid":userid,
         @"dirverid":dirverid,
         @"pub_typ":pub_typ,
         @"pub_rag":pub_rag,
         @"prov":prov,
         @"prov_detail":prov_detail,
         @"prov_lat":prov_lat,
         @"prov_lng":prov_lng,
         @"dest":dest,
         @"dest_detail":dest_detail,
         @"dest_lat":dest_lat,
         @"dest_lng":dest_lng,
         @"cargo_typ":cargo_typ,
         @"party":party,
         @"tons":tons,
         @"blf_typ":blf_typ,
         @"model_rem":model_rem,
         @"cond_rem":cond_rem,
         @"freight_exp":freight_exp,
         @"margin":margin,
         @"remark":remark,
         @"cargo_imgs":cargo_imgs
         };
         
         [self.api send:dic to:@"api.do?publishCargo" alias:[CargoPresenter publishCargo] form:self];
         */
        NSString * send_string_bg = [NSString stringWithFormat:@"};\n[self.api send:dic to:@\"%@\" alias:[self %@] form:self];",command,command];
        
        for (NSString *key in input.allKeys) {
            [as_string appendFormat:@"AS_STRING(%@IO_%@)\n",command,key];
            [def_string appendFormat:@"DEF_STRING(%@IO_%@,@\"%@IO_%@\")\n",command,key,command,key];
            [restore_string appendFormat:@"NSString *  %@ = [self doReStore:self.%@IO_%@];\n",key,command,key];
            [test_string appendFormat:@"%@ = @\"%@\";\n",key,[input valueForKey:key]];
            [send_string appendFormat:@"@\"%@\":%@,\n",key,key];
        }
#if (__ON__ == __HM_DEVELOPMENT__)
        CC( [self.class description],@"=====asstring=====\n",as_string,@"=====defstring=====\n",def_string,restore_string,test_string,@"\n#endif",send_string,send_string_bg,@"\n}");
#endif	// #if (__ON__ == __BEE_DEVELOPMENT__)
        if (!ok) {
            [sample pritfMemberForClassName:command coding:NO numberAnalysis:NO];
        }
        
    }
#endif	// #if (__ON__ == __BEE_DEVELOPMENT__)
}

+ (NSDictionary*)classNames{
    return @{@"api.do?register":[NSNull class],
             @"api.do?resetPwd":[NSNull class],
             @"api.do?changePwd":[NSNull class],
             @"api.do?login":[LoginData class],
             @"api.do?certifiedCar":[NSNull class],
             @"api.do?biddingList":[biddingList class],
             @"api.do?publishCaroptions":[publishCaroptions class],
             @"api.do?orderArrived":[NSNull class],
             @"api.do?caroptions":[caroptions class],
             @"api.do?withdrawal":[withdrawal class],
             @"api.do?setFavorites":[NSNull class],
             @"api.do?cancelCargo":[NSNull class],
             @"api.do?topup":[topup class],
             @"api.do?orderConfirmDriver":[NSNull class],
             @"api.do?cargoDetail":[cargoDetail class],
             @"api.do?bidding":[NSNull class],
             @"api.do?adlist":[adlist class],
             @"api.do?complaints":[NSNull class],
             @"api.do?payOrder":[payOrder class],
             @"api.do?myCargoList":[myCargoList class],
             @"api.do?publishCargo":[NSString class],
             @"api.do?orderCollect":[NSNull class],
             @"api.do?orderOffer":[NSNull class],
             @"api.do?certifiedUser":[NSNull class],
             @"api.do?unbindPay":[NSNull class],
             @"api.do?billList":[billList class],
             @"api.do?uploadimg":[NSString class],
             @"api.do?orderList":[orderList class],
             @"api.do?payPassword":[NSNull class],
             @"api.do?accountInfo":[NSNull class],
             @"api.do?bindPay":[NSNull class],
             @"api.do?getFavorites":[getFavorites class],
             @"api.do?carList":[carList class],
             @"api.do?msglist":[msglist class],
             @"api.do?orderDetail":[orderDetail class],
             @"api.do?bindToken":[NSNull class],
             @"api.do?orderConfirmUser":[NSNull class],
             @"api.do?userInfo":[userInfo class],
             @"api.do?cargoList":[cargoList class],
             @"api.do?orderCreate":[NSString class],
             @"api.do?certifiedDriver":[NSString class]};
}
@end


#pragma mark - act_i
@implementation act_i
@synthesize support;
@synthesize amount;
@synthesize level;
@synthesize certified;
@synthesize completion;
@synthesize star;

- (void)dealloc
{
    self.support=nil;
    self.amount=nil;
    self.level=nil;
    self.certified=nil;
    self.completion=nil;
    self.star=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - biddingItem
@implementation biddingItem
@synthesize userid;
@synthesize biddingid;
@synthesize iconid;
@synthesize bidding_remark;
@synthesize bidding_time;
@synthesize contact;
@synthesize act_i;
DEF_CONVERTPROPERTY_2_CLASS(act_i, [act_i class])
@synthesize car_i;
DEF_CONVERTPROPERTY_2_CLASS(car_i, [car_i class])
@synthesize bidding_frei;
@synthesize name;

- (void)dealloc
{
    self.userid=nil;
    self.biddingid=nil;
    self.iconid=nil;
    self.bidding_remark=nil;
    self.contact=nil;
    self.act_i=nil;
    self.bidding_frei=nil;
    self.name=nil;
    self.car_i = nil;
    self.bidding_time= nil;
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - biddingList
@implementation biddingList
@synthesize list;
DEF_CONVERTPROPERTY_2_CLASS(list, [biddingItem class])
@synthesize totoal;

- (void)dealloc
{
    self.list=nil;
    self.totoal=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - publishCaroptions
@implementation publishCaroptions
@synthesize success;
@synthesize message;
@synthesize result;
@synthesize error_code;

- (void)dealloc
{
    self.success=nil;
    self.message=nil;
    self.result=nil;
    self.error_code=nil;
    
    HM_SUPER_DEALLOC();
}

@end


#pragma mark - caropt_i
@implementation caropt_i
@synthesize dest;
@synthesize prov;
@synthesize dest_lng;
@synthesize prov_detail;
@synthesize drawout_t;
@synthesize dest_lat;
@synthesize arrived_t;
@synthesize prov_lng;
@synthesize dest_detail;
@synthesize remark;
@synthesize prov_lat;
@synthesize pathway;

- (void)dealloc
{
    self.dest=nil;
    self.prov=nil;
    self.dest_lng=nil;
    self.prov_detail=nil;
    self.drawout_t=nil;
    self.dest_lat=nil;
    self.arrived_t=nil;
    self.prov_lng=nil;
    self.dest_detail=nil;
    self.remark=nil;
    self.prov_lat=nil;
    self.pathway=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - car_i
@implementation car_i
@synthesize car_iconid;
@synthesize enterprise;
@synthesize diver_cell;
@synthesize comm_addrs;
@synthesize party;
@synthesize plate;
@synthesize owner_cell;
@synthesize tons;
@synthesize address;
@synthesize operacert_iconid;
@synthesize conductor;
@synthesize license_iconid;
@synthesize certified;
@synthesize model;
@synthesize carid;

- (void)dealloc
{
    self.car_iconid=nil;
    self.enterprise=nil;
    self.diver_cell=nil;
    self.comm_addrs=nil;
    self.party=nil;
    self.plate=nil;
    self.owner_cell=nil;
    self.tons=nil;
    self.address=nil;
    self.operacert_iconid=nil;
    self.conductor=nil;
    self.license_iconid=nil;
    self.certified=nil;
    self.model=nil;
    self.carid = nil;
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - driver
@implementation driver
@synthesize rule;
@synthesize act_i;
DEF_CONVERTPROPERTY_2_CLASS(act_i, [act_i class])
@synthesize userid;
@synthesize iconid;
@synthesize name;
@synthesize contact;

- (void)dealloc
{
    self.rule=nil;
    self.act_i=nil;
    self.userid=nil;
    self.iconid=nil;
    self.name=nil;
    self.contact=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - caroptionsItem
@implementation caroptionsItem
@synthesize caropt_i;
DEF_CONVERTPROPERTY_2_CLASS(caropt_i, [caropt_i class])
@synthesize caroptid;
@synthesize car_i;
DEF_CONVERTPROPERTY_2_CLASS(car_i, [car_i class])
@synthesize driver;
DEF_CONVERTPROPERTY_2_CLASS(driver, [driver class])

- (void)dealloc
{
    self.caropt_i=nil;
    self.caroptid=nil;
    self.car_i=nil;
    self.driver=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - caroptions
@implementation caroptions
@synthesize list;
DEF_CONVERTPROPERTY_2_CLASS(list, [caroptionsItem class])
@synthesize totoal;

- (void)dealloc
{
    self.list=nil;
    self.totoal=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - withdrawal
@implementation withdrawal
@synthesize serial_num;
@synthesize product;

- (void)dealloc
{
    self.serial_num=nil;
    self.product=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - topup
@implementation topup
@synthesize serial_num;
@synthesize money;
@synthesize product;

- (void)dealloc
{
    self.serial_num=nil;
    self.money=nil;
    self.product=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - owner
@implementation owner
@synthesize act_i;
DEF_CONVERTPROPERTY_2_CLASS(act_i, [act_i class])
@synthesize userid;
@synthesize iconid;
@synthesize name;
@synthesize contact;
@synthesize rule;

- (void)dealloc
{
    self.act_i=nil;
    self.userid=nil;
    self.iconid=nil;
    self.name=nil;
    self.contact=nil;
    self.rule = nil;
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - cargo
@implementation cargo
@synthesize party;
@synthesize margin;
@synthesize prov_lng;
@synthesize prov;
@synthesize prov_lat;
@synthesize pub_rag;
@synthesize model_rem;
@synthesize freight_exp;
@synthesize tons;
@synthesize blf_typ;
@synthesize cond_rem;
@synthesize dest_detail;
@synthesize cargo_typ;
@synthesize consi_cont;
@synthesize pub_typ;
@synthesize prov_detail;
@synthesize dest_lng;
@synthesize dest_lat;
@synthesize remark;
@synthesize dest;
@synthesize cargo_imgs;
@synthesize consi;
@synthesize bidding;
@synthesize bidding_low;

- (void)dealloc
{
    self.party=nil;
    self.margin=nil;
    self.prov_lng=nil;
    self.prov=nil;
    self.prov_lat=nil;
    self.pub_rag=nil;
    self.model_rem=nil;
    self.freight_exp=nil;
    self.tons=nil;
    self.blf_typ=nil;
    self.cond_rem=nil;
    self.dest_detail=nil;
    self.cargo_typ=nil;
    self.consi_cont=nil;
    self.pub_typ=nil;
    self.prov_detail=nil;
    self.dest_lng=nil;
    self.dest_lat=nil;
    self.remark=nil;
    self.dest=nil;
    self.cargo_imgs=nil;
    self.consi=nil;
    self.bidding_low=nil;
    self.bidding=nil;
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - cargoDetail
@implementation cargoDetail
@synthesize cargoid;
@synthesize owner;
DEF_CONVERTPROPERTY_2_CLASS(owner, [owner class])
@synthesize cargo;
DEF_CONVERTPROPERTY_2_CLASS(cargo, [cargo class])

- (void)dealloc
{
    self.cargoid=nil;
    self.owner=nil;
    self.cargo=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - adItem
@implementation adItem
@synthesize adid;
@synthesize title;
@synthesize iconid;
@synthesize url;

- (void)dealloc
{
    self.adid=nil;
    self.title=nil;
    self.iconid=nil;
    self.url=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - adlist
@implementation adlist
@synthesize list;
DEF_CONVERTPROPERTY_2_CLASS(list, [adItem class])
@synthesize totoal;

- (void)dealloc
{
    self.list=nil;
    self.totoal=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - payOrder
@implementation payOrder
@synthesize serial_num;
@synthesize money;
@synthesize product;

- (void)dealloc
{
    self.serial_num=nil;
    self.money=nil;
    self.product=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - biddingItem

#pragma mark - bidding
@implementation bidding
@synthesize total;
@synthesize list;
DEF_CONVERTPROPERTY_2_CLASS(list, [biddingItem class])

- (void)dealloc
{
    self.total=nil;
    self.list=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - myCargoItem
@implementation myCargoItem
@synthesize state;
@synthesize owner;
DEF_CONVERTPROPERTY_2_CLASS(owner, [owner class])
@synthesize cargo;
DEF_CONVERTPROPERTY_2_CLASS(cargo, [cargo class])
@synthesize bidding;
DEF_CONVERTPROPERTY_2_CLASS(bidding, [bidding class])
@synthesize cargoid;

- (void)dealloc
{
    self.state=nil;
    self.owner=nil;
    self.cargo=nil;
    self.bidding=nil;
    self.cargoid=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - myCargoList
@implementation myCargoList
@synthesize list;
DEF_CONVERTPROPERTY_2_CLASS(list, [myCargoItem class])
@synthesize totoal;

- (void)dealloc
{
    self.list=nil;
    self.totoal=nil;
    
    HM_SUPER_DEALLOC();
}

@end
#pragma mark - publishCargo


#pragma mark - billItem
@implementation billItem
@synthesize billid;
@synthesize account;
@synthesize trade_t;
@synthesize remark;
@synthesize orderid;
@synthesize apply_t;
@synthesize serial_num;
@synthesize type;
@synthesize money;
@synthesize state;

- (void)dealloc
{
    self.billid=nil;
    self.account=nil;
    self.trade_t=nil;
    self.remark=nil;
    self.orderid=nil;
    self.apply_t=nil;
    self.serial_num=nil;
    self.type=nil;
    self.money=nil;
    self.state=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - billList
@implementation billList
@synthesize list;
DEF_CONVERTPROPERTY_2_CLASS(list, [billItem class])
@synthesize totoal;

- (void)dealloc
{
    self.list=nil;
    self.totoal=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - uploadimg
@implementation uploadimg
@synthesize success;
@synthesize message;
@synthesize result;
@synthesize error_code;

- (void)dealloc
{
    self.success=nil;
    self.message=nil;
    self.result=nil;
    self.error_code=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - bidded
@implementation bidded
@synthesize bidding_remark;
@synthesize userid;
@synthesize iconid;
@synthesize name;
@synthesize bidding_frei;
@synthesize contact;

- (void)dealloc
{
    self.bidding_remark=nil;
    self.userid=nil;
    self.iconid=nil;
    self.name=nil;
    self.bidding_frei=nil;
    self.contact=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - order
@implementation orderInfo
@synthesize star_driver;
@synthesize remark_user;
@synthesize star_user;
@synthesize consi;
@synthesize freight_real;
@synthesize orderid;
@synthesize consi_cont;
@synthesize order_state;
@synthesize remark_driver;
@synthesize order_num;
@synthesize blf_typ_real;
@synthesize order_t;
//0:待确认 1:配送中 2:已送达 3:已签收\待支付 4:已支付 5:已完成(评价完成) 6:已取消

- (NSString *)order_stateDes{
    if ([self.order_state is:@"1"]) {
        return @"配送中";
    }else if ([self.order_state is:@"2"]) {
        return @"已送达";
    }else if ([self.order_state is:@"3"]) {
        return @"待支付";
    }else if ([self.order_state is:@"4"]) {
        return @"已支付";
    }else if ([self.order_state is:@"5"]) {
        return @"已完成";
    }else if ([self.order_state is:@"6"]) {
        return @"已取消";
    }
    return @"待确认";
}

- (void)dealloc
{
    self.star_driver=nil;
    self.remark_user=nil;
    self.star_user=nil;
    self.consi=nil;
    self.freight_real=nil;
    self.orderid=nil;
    self.consi_cont=nil;
    self.order_state=nil;
    self.remark_driver=nil;
    self.order_num=nil;
    self.blf_typ_real=nil;
    self.order_t=nil;
    
    HM_SUPER_DEALLOC();
}

@end


#pragma mark - cargo
@implementation ordercargo
@synthesize remark;
@synthesize dest;
@synthesize tons;
@synthesize model_rem;
@synthesize pub_rag;
@synthesize party;
@synthesize cargo_typ;
@synthesize prov;
@synthesize blf_typ;
@synthesize pub_typ;

- (void)dealloc
{
    self.remark=nil;
    self.dest=nil;
    self.tons=nil;
    self.model_rem=nil;
    self.pub_rag=nil;
    self.party=nil;
    self.cargo_typ=nil;
    self.prov=nil;
    self.blf_typ=nil;
    self.pub_typ=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - orderItem
@implementation orderItem
@synthesize bidded;
DEF_CONVERTPROPERTY_2_CLASS(bidded, [bidded class])
@synthesize state;
@synthesize order;
DEF_CONVERTPROPERTY_2_CLASS(order, [orderInfo class])
@synthesize owner;
DEF_CONVERTPROPERTY_2_CLASS(owner, [owner class])
@synthesize cargo;
DEF_CONVERTPROPERTY_2_CLASS(cargo, [ordercargo class])
@synthesize cargoid;

- (void)dealloc
{
    self.bidded=nil;
    self.state=nil;
    self.order=nil;
    self.owner=nil;
    self.cargo=nil;
    self.cargoid=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - orderList
@implementation orderList
@synthesize list;
DEF_CONVERTPROPERTY_2_CLASS(list, [orderItem class])
@synthesize totoal;

- (void)dealloc
{
    self.list=nil;
    self.totoal=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - pay_i
@implementation pay_i
@synthesize balance;
@synthesize balance_use;
@synthesize balance_use_des;

- (void)dealloc
{
    self.balance=nil;
    self.balance_use=nil;
    self.balance_use_des=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - integral_i
@implementation integral_i
@synthesize integral;
@synthesize integral_use;
@synthesize integral_use_des;

- (void)dealloc
{
    self.integral=nil;
    self.integral_use=nil;
    self.integral_use_des=nil;
    
    HM_SUPER_DEALLOC();
}

@end


#pragma mark - account_i
@implementation account_i
@synthesize support;
@synthesize amount;
@synthesize level;
@synthesize certified;
@synthesize completion;
@synthesize star;

- (void)dealloc
{
    self.support=nil;
    self.amount=nil;
    self.level=nil;
    self.certified=nil;
    self.completion=nil;
    self.star=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - accountInfo
@implementation accountInfo
@synthesize pay_i;
DEF_CONVERTPROPERTY_2_CLASS(pay_i, [pay_i class])
@synthesize integral_i;
DEF_CONVERTPROPERTY_2_CLASS(integral_i, [integral_i class])
@synthesize account_i;
DEF_CONVERTPROPERTY_2_CLASS(account_i, [account_i class])

- (void)dealloc
{
    self.pay_i=nil;
    self.integral_i=nil;
    self.account_i=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - identity_i
@implementation identity_i
@synthesize ent_iconid;
@synthesize identity;
@synthesize enterprise;
@synthesize contact;
@synthesize ent_address;
@synthesize identity_iconid;
@synthesize iconid;
@synthesize driving_licence_iconid;
@synthesize rule;
@synthesize driving_licence;
@synthesize driving_company;
@synthesize identity_back_iconid;
@synthesize name;
@synthesize ent_detail_address;

- (void)dealloc
{
    self.ent_iconid=nil;
    self.identity=nil;
    self.enterprise=nil;
    self.contact=nil;
    self.ent_address=nil;
    self.identity_iconid=nil;
    self.iconid=nil;
    self.driving_licence_iconid=nil;
    self.rule=nil;
    self.driving_licence=nil;
    self.driving_company=nil;
    self.identity_back_iconid=nil;
    self.name=nil;
    self.ent_detail_address=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - favoritesItem
@implementation favoritesItem
@synthesize userid;
@synthesize identity_i;
DEF_CONVERTPROPERTY_2_CLASS(identity_i, [identity_i class])
@synthesize account_i;
DEF_CONVERTPROPERTY_2_CLASS(account_i, [account_i class])

- (void)dealloc
{
    self.userid=nil;
    self.identity_i=nil;
    self.account_i=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - getFavorites
@implementation getFavorites
@synthesize total;
@synthesize list;
DEF_CONVERTPROPERTY_2_CLASS(list, [favoritesItem class])

- (void)dealloc
{
    self.total=nil;
    self.list=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - carItem
@implementation carItem
@synthesize car_i;
DEF_CONVERTPROPERTY_2_CLASS(car_i, [car_i class])
@synthesize driver;
DEF_CONVERTPROPERTY_2_CLASS(driver, [driver class])

- (void)dealloc
{
    self.car_i=nil;
    self.driver=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - carList
@implementation carList
@synthesize list;
DEF_CONVERTPROPERTY_2_CLASS(list, [carItem class])
@synthesize totoal;

- (void)dealloc
{
    self.list=nil;
    self.totoal=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - msgItem
@implementation msgItem
@synthesize url;
@synthesize title;
@synthesize content;
@synthesize msgid;
@synthesize type;
@synthesize iconid;
@synthesize time;
//|1:系统消息 2:业务消息 3:推广消息
- (NSString *)typeDes{
    if ([type is:@"2"]) {
        return @"业务";
    }else if ([type is:@"3"]){
        return @"推广";
    }
    return @"系统";
}

- (void)dealloc
{
    self.url=nil;
    self.title=nil;
    self.content=nil;
    self.msgid=nil;
    self.type=nil;
    self.iconid=nil;
    self.time = nil;
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - msglist
@implementation msglist
@synthesize list;
DEF_CONVERTPROPERTY_2_CLASS(list, [msgItem class])
@synthesize totoal;

- (void)dealloc
{
    self.list=nil;
    self.totoal=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - order
@implementation orderDetailorder
@synthesize weigh_numid_real;
@synthesize tons_real;
@synthesize remark;
@synthesize freight;
@synthesize tons;
@synthesize star_user;
@synthesize weigh_num_real;
@synthesize party_real;
@synthesize orderid;
@synthesize create_t;
@synthesize weigh_num;
@synthesize remark_user;
@synthesize remark_driver;
@synthesize serial_num_dirver;
@synthesize margin_dirver;
@synthesize star_driver;
@synthesize party;
@synthesize pay_t;
@synthesize arrive_t;
@synthesize serial_num;
@synthesize sign_t;
@synthesize weigh_numid;
@synthesize order_num;
@synthesize freight_break;
@synthesize order_state;
@synthesize blf_typ;
@synthesize arrive_lat;
@synthesize collect_t;
@synthesize order_t;
@synthesize blf_typ_real;
@synthesize freight_real;
@synthesize arrive_lng;
@synthesize margin_rem;
@synthesize margin;

- (void)dealloc
{
    self.weigh_numid_real=nil;
    self.tons_real=nil;
    self.remark=nil;
    self.freight=nil;
    self.tons=nil;
    self.star_user=nil;
    self.weigh_num_real=nil;
    self.party_real=nil;
    self.orderid=nil;
    self.create_t=nil;
    self.weigh_num=nil;
    self.remark_user=nil;
    self.remark_driver=nil;
    self.serial_num_dirver=nil;
    self.margin_dirver=nil;
    self.star_driver=nil;
    self.party=nil;
    self.pay_t=nil;
    self.arrive_t=nil;
    self.serial_num=nil;
    self.sign_t=nil;
    self.weigh_numid=nil;
    self.order_num=nil;
    self.freight_break=nil;
    self.order_state=nil;
    self.blf_typ=nil;
    self.arrive_lat=nil;
    self.collect_t=nil;
    self.order_t=nil;
    self.blf_typ_real=nil;
    self.freight_real=nil;
    self.arrive_lng=nil;
    self.margin_rem=nil;
    self.margin=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - orderDetail
@implementation orderDetail
@synthesize bidded;
DEF_CONVERTPROPERTY_2_CLASS(bidded, [bidded class])
@synthesize state;
@synthesize order;
DEF_CONVERTPROPERTY_2_CLASS(order, [orderDetailorder class])
@synthesize owner;
DEF_CONVERTPROPERTY_2_CLASS(owner, [owner class])
@synthesize cargo;
DEF_CONVERTPROPERTY_2_CLASS(cargo, [cargo class])
@synthesize cargoid;

- (void)dealloc
{
    self.bidded=nil;
    self.state=nil;
    self.order=nil;
    self.owner=nil;
    self.cargo=nil;
    self.cargoid=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - LoginData
@implementation LoginData
@synthesize userid;

- (void)dealloc
{
    self.userid=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - userInfo
@implementation userInfo
@synthesize account_i;
DEF_CONVERTPROPERTY_2_CLASS(account_i, [account_i class])
@synthesize userid;
@synthesize identity_i;
DEF_CONVERTPROPERTY_2_CLASS(identity_i, [identity_i class])
@synthesize car_i;
DEF_CONVERTPROPERTY_2_CLASS(car_i, [car_i class])

- (void)dealloc
{
    self.account_i=nil;
    self.userid=nil;
    self.identity_i=nil;
    self.car_i=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - cargoItem
@implementation cargoItem
@synthesize cargoid;
@synthesize owner;
DEF_CONVERTPROPERTY_2_CLASS(owner, [owner class])
@synthesize cargo;
DEF_CONVERTPROPERTY_2_CLASS(cargo, [cargo class])

- (void)dealloc
{
    self.cargoid=nil;
    self.owner=nil;
    self.cargo=nil;
    
    HM_SUPER_DEALLOC();
}

@end

#pragma mark - cargoList
@implementation cargoList
@synthesize list;
DEF_CONVERTPROPERTY_2_CLASS(list, [cargoItem class])
@synthesize totoal;

- (void)dealloc
{
    self.list=nil;
    self.totoal=nil;
    
    HM_SUPER_DEALLOC();
}

@end


#pragma mark - orderCreate
@implementation orderCreate
@synthesize success;
@synthesize message;
@synthesize result;
@synthesize error_code;

- (void)dealloc
{
    self.success=nil;
    self.message=nil;
    self.result=nil;
    self.error_code=nil;
    
    HM_SUPER_DEALLOC();
}

@end